<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ASIMS</title>
<link href="../CSS/style.css" rel="stylesheet" type="text/css" />
</head>

<script type="text/javascript">
function Checkname()
{
 	var Name=document.getElementById("sname").value;
 	if(Name.length=="")
 	{
 		document.getElementById("Rname").style.color="red";
		document.getElementById("Rname").innerHTML=" 请输入设施名称！";
 	}else
 	{
 		document.getElementById("Rname").innerHTML="";
	}
}

function Checkplace()
{
	var Place=document.getElementById("splace").value;
	if(Place.length=="")
	 {
	 	document.getElementById("Rplace").style.color="red";
		document.getElementById("Rplace").innerHTML=" 请输入位置！";
	 }else
	 {
	 	document.getElementById("Rplace").innerHTML="";
	 }
}

function Checknumber()
{
	var Number=document.getElementById("snumber").value;
	for(var i=0;i<Number.length;i++)
	{
	  if(Number.charAt(i)<"0" || Number.charAt(i)>"9")
	  {
	   document.getElementById("Rnumber").style.color="red";
	   document.getElementById("Rnumber").innerHTML="数量只能是数字！";
	   return false;
	  }
	}
	if(Number.length=="")
	 {
	 	document.getElementById("Rnumber").style.color="red";
		document.getElementById("Rnumber").innerHTML=" 请输入数量！";
	 }else
	 {
	 	document.getElementById("Rnumber").innerHTML="";
	 }
}

function Checktele()
{
	var Tele=document.getElementById("stele").value;
	for(var i=0;i<Tele.length;i++)
	{
	  if(Tele.charAt(i)<"0" || Tele.charAt(i)>"9")
	  {
	   document.getElementById("Rtele").style.color="red";
	   document.getElementById("Rtele").innerHTML="电话号只能是数字！";
	   return false;
	  }
	}
	if(Tele.length=="")
	 {
	 	document.getElementById("Rtele").style.color="red";
		document.getElementById("Rtele").innerHTML=" 请输入电话！";
	 }
	  else if(Tele.length<0 || Tele.length>12)
	 {
		  document.getElementById("Rtele").style.color="red";
		  document.getElementById("Rtele").innerHTML=" 电话号码最多12位，且只能是数字";
		  return false;
	 }
	 else
	 {
	 	document.getElementById("Rtele").innerHTML="";
	 }
}
</script>

<body>
	<div id="wrap">
		<div id="header">
			<h1 id="sitename"><a href="#">ASIMS</a></h1>
				<div id="nav">
					<div id="titleblock">
						<div id="subject">机场静态信息管理系统</div>
						<div id="spirit"><a href="#"><%= session.getAttribute("username") %>  已登录</a> | <a href="queryUserForIndex.action" target="_parent">个人信息维护</a> | <a href="../login/login.jsp" target="_parent">注销</a></div>
				 	</div>
				<div id="topmenu">
					<ul>
						<li><a href="../login/index.jsp">首页</a></li>
						<li><a href="../rolemanage/user_manag.jsp">用户和角色管理</a></li>
						<li><a href="../airline_manage/airline_manag_InAr.jsp">航班信息管理</a></li>
						<li class="active"><a href="../facilities_manag/facilities_manag.jsp">机场设施管理</a></li>
						<li><a href="../news/news_view_intr.jsp">新闻中心</a></li>
					</ul>
				</div>
			</div>
		<div class="clear"></div>
		<div id="breadcrumb">网站路径：<a href="../login/index.jsp">首页</a> &raquo; <a href="#"  class="active">机场设施管理</a></div>
	</div>

	<div id="content">
		<div id="right">
		   <div class="post">
				<h2><a href="">新增物业设施</a></h2>
					<form action="addResource.action" method="post" enctype="multipart/form-data">
						<div class="contactform">
							<p class="first">
								<label for="resourcename">设施名称： </label><div class="STYLE2" id="Rname"></div>
								<s:textfield name="resource.resourcename" id="sname" onblur="Checkname()"></s:textfield>
							</p>
							<p>
								<label for="place">位　　置：</label><div class="STYLE2" id="Rplace"></div>
								<s:textfield name="resource.place" id="splace" onblur="Checkplace()"></s:textfield>
							</p>
							<p>
								<label for="number">数　　量：</label><div class="STYLE2" id="Rnumber"></div>
								<s:textfield name="resource.number" id="snumber" onblur="Checknumber()"></s:textfield>
							</p>
							<p>
								<label for="telephone">电　　话：</label><div class="STYLE2" id="Rtele"></div>
								<s:textfield name="resource.telephone" id="stele" onblur="Checktele()"></s:textfield>
							</p>
							<p>
								<label for="remark">备　　注：</label><div class="STYLE2" id="Remark"></div>
								<s:textfield name="resource.remark"></s:textfield>
							</p>
							<div class="buttons">
								<div class="butarea2"></div>
								<button type="submit" name="add" >
									<img src="../images/import16.png" alt=""/> 
									保存
								</button>
								<button type="reset" name="cancel" onClick="javascript:window.location.href='queryResourceAuto.action'">
									<img src="../images/cancel16.png" alt=""/> 
									取消
								</button>
							</div>
						</div>
					</form>
			</div>
		</div>
	
		<div id="sidebar">
			<div id="sidebartop"></div>
				<h2>机场设施管理</h2>
					<ul>
					  <li><a href="queryFacilityAuto.action">机场资源</a></li>
					  <li class="active"><a href="queryResourceAuto.action">物业设施</a></li>
					</ul>
		</div>
		<div class="clear"></div>
			<div id="bottom">
				<p><img src="../images/copyright.jpg" /></p>
				<p><a href="">隐私权</a> | <a href="">&copy;版权</a> | <a href="">法律声明</a> | <a href="">电子邮件：admin@163.com</a>
			</div>
		</div>
	
		<div id="footer">
			<div id="credits">
			ASIMS Power by IBM
			</div>
		</div>
	</div>

</body>
</html>

